package com.justin.oauthresource.service.impl;

import com.justin.oauthresource.domain.Content;
import com.justin.oauthresource.mapper.ContentMapper;
import com.justin.oauthresource.service.ContentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ContentServiceImpl implements ContentService {

    @Resource
    private ContentMapper tbContentMapper;

    @Override
    public Content getById(Long id) {
        return tbContentMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Content> selectAll() {
        return tbContentMapper.selectAll();
    }

    @Override
    public int insert(Content tbContent) {
        return tbContentMapper.insert(tbContent);
    }

    @Override
    public int update(Content tbContent) {
        return tbContentMapper.updateByPrimaryKey(tbContent);
    }

    @Override
    public int delete(Long id) {
        return tbContentMapper.deleteByPrimaryKey(id);
    }
}
